package org.mybatis.generator.myextents;

import com.demo.constans.ApiConstans;

public class StringUtils extends org.apache.commons.lang3.StringUtils
{
    public static String replaceSystemName(String text)
    {
        text = replaceEach(text, ApiConstants.SYSTEM_ABBRS1, ApiConstants.SYSTEM_ABBRS1_REPLACE);
        text = replaceEach(text, ApiConstants.SYSTEM_ABBRS2, ApiConstants.SYSTEM_ABBRS2_REPLACE);
        return text;
    }
    
    /**
     * 获取变更记录
     *
     * @return
     */
    public static String getChangeRecord()
    {
        StringBuilder sb = new StringBuilder();
        sb.append("/**").append("\n").append(" * CHANGE HISTORY").append("\n").append(
            "* M1 2020-08-23 ")
            .append(ApiConstans.HEADER_CLASS.getUserName()).append(" Create").append("\n").append("*/");
        
        /**
         * CHANGE HISTORY
         * M1 2020-08-21 825338623@qq.com Create
         */
        return sb.toString();
    }
    
    /**
     * 获取错误枚举包名
     *
     * @return
     */
    public static String getErrorPacageName()
    {
        if (equalsIgnoreCase(ApiConstans.HEADER_CLASS.getSysEnName(), "sss")) {
            return "cn.com.bobfintech.commons.enums.BobfintechErrorNoEnum";
        }
        else {
            return "cn.com.bobfintech.commons.enums.BobfintechErrorNoEnum";
        }
    }
    
    /**
     * 获取错误枚举类名
     *
     * @return
     */
    public static String getErrorClassName()
    {
        
        if (equalsIgnoreCase(ApiConstans.HEADER_CLASS.getSysEnName(), "sss")) {
            return "SSSErrorNoEnum";
        }
        else {
            return "BobfintechErrorNoEnum";
        }
        
    }
    
    public static void main(String[] args)
    {
        System.out.println(StringUtils.replaceSystemName("t_sss_a_base"));
    }
}
